package com.firemoss.atonement.changewatcher.observation
{
	import flash.utils.Dictionary;

	public class PropertyChanges
	{
		private var changes : Dictionary = new Dictionary()
			
		public function PropertyChanges( propertyChangeList : Array )
		{
			for each ( var change : PropertyChange in propertyChangeList )
			{
				if ( changes[ change.propertyName ] == null )
				{
					changes[ change.propertyName ] = change.clone();
				}
				else
				{
					// We're not updating the original, but a clone...
					changes[ change.propertyName ].newValue = change.newValue;
				}
			}
		}
		
		public function forProperty( propertyName : String ) : PropertyChange
		{
			return changes[ propertyName ];
		}
	}
}